from django.db import models

# Create your models here.
class Powerone(models.Model):
    name = models.CharField(max_length=100)
    value = models.IntegerField()
    timestamp = models.DateTimeField(auto_now_add=True)
    class Meta:
        db_table = 'powerone'

class Powertwo(models.Model):
    name = models.CharField(max_length=100)
    value = models.IntegerField()
    timestamp = models.DateTimeField(auto_now_add=True)
    class Meta:
        db_table = 'powertwo'

class Powerthree(models.Model):
    name = models.CharField(max_length=100)
    value = models.IntegerField()
    timestamp = models.DateTimeField(auto_now_add=True)
    class Meta:
        db_table = 'powerthree'



class Powerall(models.Model):
    name = models.CharField(max_length=100)
    value = models.IntegerField()

class Move(models.Model):
    name = models.CharField(max_length=100)
    value = models.IntegerField()
    timestamp = models.DateTimeField(auto_now_add=True)

class Change(models.Model):
    name = models.CharField(max_length=100)
    value = models.IntegerField()
    timestamp = models.DateTimeField(auto_now_add=True)

class Windpressure(models.Model):
    name = models.CharField(max_length=100)
    value = models.IntegerField()
    timestamp = models.DateTimeField(auto_now_add=True)

class Fissure(models.Model):
    name = models.CharField(max_length=100)
    value = models.IntegerField()
    timestamp = models.DateTimeField(auto_now_add=True)




class Event(models.Model):
    date = models.DateField(unique=True)
    content = models.TextField(blank=True)

    def __str__(self):
        return f"Event on {self.date}"






from django import forms

class EventForm(forms.ModelForm):
    class Meta:
        model = Event
        fields = ['content']
        widgets = {
            'content': forms.Textarea(attrs={'class': 'form-control', 'rows': 5}),
        }




